//
//  SelectionScrollView.h
//  TabulaImaginarius4
//
//  Created by TA2 on 6/6/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <QuartzCore/QuartzCore.h>
#import <UIKit/UIKit.h>
#import "SelectionImageView.h"
#import "LoadedImages.h"
#import "MapScrollView.h"
#import "NetworkProtocol.h"


@interface SelectionScrollView : UIScrollView <UIScrollViewDelegate> {
	UIPinchGestureRecognizer	*zoomGesture;
	NSTimer						*timer;
	CGPoint						currentPoint;
	CGSize						tileSize;
	CABasicAnimation			*selectionAnimation;
	SelectionImageView			*lastSelectedTokenView;
    SelectionImageView			*lastSelectedObjectView;
	SelectionImageView			*lastSelectedBackgroundView;
	SelectionImageView			*lastSelectedMainBackgroundView;
    SelectionImageView          *lastColorView;
    SelectionImageView          *lastSnapColorView;
	NSMutableArray				*tokenImageViews;
    NSMutableArray				*objectImageViews;
	NSMutableArray				*backgroundImageViews;
	NSMutableArray				*mainBackgroundViews;
	NSMutableArray				*currentImageViews;
    NSMutableArray              *colorViews;
    NSMutableArray              *snapColorViews;
	BOOL						changeMainBackgroundsMode;
	MapScrollView				*contentView;
    IBOutlet UIButton           *eraserButton;
}

@property (nonatomic, retain) UIPinchGestureRecognizer *zoomGesture;
@property (nonatomic) CGSize tileSize;
@property (nonatomic, retain) NSMutableArray *tokenImageViews;
@property (nonatomic, retain) NSMutableArray *backgroundImageViews;
@property (nonatomic, retain) NSMutableArray *mainBackgroundViews;
@property (nonatomic, retain) NSMutableArray *objectImageViews;
@property (nonatomic, retain) NSMutableArray *colorViews;
@property (nonatomic, retain) NSMutableArray *snapColorViews;
@property (nonatomic, retain) NSMutableArray *currentImageViews;
@property (nonatomic) BOOL changeMainBackgroundsMode;
@property (nonatomic, retain) MapScrollView *contentView;

- (CGPoint)maximumContentOffset;
- (CGPoint)minimumContentOffset;
- (void)selectIcon;
- (void)selectMainBackgroundIcon:(NSString *)path;
- (void)makeTokenSelectArray;
- (void)makeBackgroundSelectArray;
- (void)makeAllBackgroundSelectArray;
- (void)makeObjectSelectArray;
- (void)makeColorSelectArray;
- (void)makeSnapColorSelectArray;
- (void)setUpSelectionScroller:(NSMutableArray *)elements;
- (void)fade:(UIView *)view fromValue:(float)fromValue toValue:(float)toValue withDuration:(float)duration;

@end
